package com.recharge.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.recharge.common.result.ResultDO;
import com.recharge.core.entity.ProviderOrderEntity;
import com.recharge.domain.query.ProviderOrderQueryDO;
import com.recharge.domain.vo.ProviderOrderDO;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author reagan
 * @since 2020-08-19
 */
public interface ProviderOrderService extends IService<ProviderOrderEntity> {
    /**
     * 添加上游供货单
     * @param domain
     * @return
     */
    public ResultDO add(ProviderOrderDO domain);

    /**
     * 根据id修改状态和供货单编号
     * @param orderId
     * @param providerOrderNo
     * @param status
     * @return
     */
    public ResultDO updateProviderOrderStatus(String orderId, String providerOrderNo, int status, String voucherNo, String serialNumber);
    /**
     * 充值单详情
     * @param id
     * @return
     */
    public ResultDO get(String id);
    /**
     * 获取供货单信息，对外开发的接口方法
     * @param providerId 供应商ID
     * @param providerOrderNo 供应单编号
     * @return
     */
    public ResultDO get(String providerId, String providerOrderNo);

    /**
     * 删除供货单
     * @param id
     * @param userName
     * @return
     */
    public ResultDO remove(String id, String userName);

    /**
     * 返回失败供应单
     * @param orderNo
     * @param providerId
     * @return
     */
    public ResultDO getProviderOrderFail(String orderNo, String providerId);

    /**
     * 查询供货单
     * @param domain
     * @return
     */
    public ResultDO find(ProviderOrderQueryDO domain);

    /**
     * 统计供货单
     * @param domain
     * @return
     */
    public ResultDO reportOrder(ProviderOrderQueryDO domain);
    /**
     * 	批量供货单成功，失败
     * 	@param resetType all:重置所有，next:重置到下一个，current:当前
     * @param status 成功或失败状态 Constant.PROVIDER_ORDER_STATUS_fail  Constant.PROVIDER_ORDER_STATUS_2
     * @param ids  id字符串
     * @param isOver 是否供应结束 1：是，0：否
     * @return
     */
    public ResultDO updateBatch(String resetType, Integer status, String[] ids, Integer isOver, Map<String, String> map, String userName);

    /**
     * 批量核单
     * @param ids
     * @return
     */
    public ResultDO vouchingBatch(String[] ids, String userName);

    /**
     * 单笔核单
     * @param param
     * @return
     */
    public ResultDO vouchingProviderOrder(ProviderOrderDO param);

    /**
     *  供货单核单
     * @param param
     * @param userName
     * @return
     */
    public ResultDO edit(ProviderOrderDO param, String userName);

    /**
     * 供货订单导出
     * @param query
     * @return
     */
    public ResultDO findList(ProviderOrderQueryDO query);
}
